
package cz.muni.fi.pa165.carpark.dao;

import cz.muni.fi.pa165.carpark.EmployeePosition;
import cz.muni.fi.pa165.carpark.VehicleStatus;
import cz.muni.fi.pa165.carpark.entities.ServiceCheck;
import cz.muni.fi.pa165.carpark.entities.Vehicle;
import java.util.List;

/**
 *
 * @author xmarton1
 */
public interface VehicleDAO {

    /*
     * This method inserts Vehicle vehicle in the database.
     * While inserting, vehicle is given unique id
     * @param vehicle instance of Vehicle  to be created     
     */
    public void create(Vehicle vehicle);

    /*
     * This method get instance of Vehicle, specified with given id, from database.
     * @param id id of Vehicle to be retrieved
     * @return instance of Vehicle with given id     
     */
    public Vehicle get(Long id);

    /*
     * This method updates state of Vehicle into database
     * @param vehicle instance of Vehicle to be updated in database     * 
     */
    public void update(Vehicle vehicle);

    /*
     * This method removes Vehicle vehicle from database.
     * @param vehicle instance of Vehicle to be removed
     */
    public void remove(Vehicle vehicle);
    
    /*
     * @return active serviceCheck, if Vehicle is in service
     */
    public List<ServiceCheck> getActiveServiceChecks(Vehicle vehicle,boolean active);
    
    /*
     * This method finds all available vehicles for given position.
     * @param position instance of EmployeePosition
     * @return list of Vehicles available for given position
     */
    public List<Vehicle> findAllVehiclesForPosition(EmployeePosition position);

    /*
     * This method find all vehicles including vehicles on service check.
     * @return list of all Vehicles 
     */
    public List<Vehicle> findAllVehicles();
        
    /*
     * This methd return all Vehicles with selected status
     * @param status = VehicleStatus
     * @return list of all Vehicles with this status
     */
    public List<Vehicle> getVehiclesByStatus(VehicleStatus status);
    
}
